﻿import odal.*;
class odal.OMSDatasource {
	private var m_datasource:Object;
	
	public function OMSDatasource() {
	}//OMSDatasource

	public function get Datasource():Object {
		return this.m_datasource;
	}//set Datasource

	public function get OmsStructure():OMSStructure {
		if ( this.m_datasource == null ) {
			trace ( '[OMSDatasource.OmsStructure] Source not set!' );
			return null;
		}//if
//		trace ( '[OMSDatasource.get OmsStructure] this.m_datasource.toString:\n' + this.m_datasource.toString() );
		var omsStructure:OMSStructure = new OMSStructure();
		this.addData2Structure( omsStructure );
		this.addRelations2Structure( omsStructure );
		return omsStructure;
	}//get OmsStructure
	
	public function resetDatasource() {
		this.m_datasource = null;
	}//resetDatasource	
	
	private function addData2Structure( p_omsStructure:OMSStructure ) {
		trace ( '[OMSDatasource.addData2Stucture] addData2Stucture not implemented in inheriting class!' );
	}//addData2Stucture
	
	private function addRelations2Structure( p_omsStructure:OMSStructure ) {
		trace ( '[OMSDatasource.addRelations2Structure] addRelations2Structure not implemented in inheriting class!' );
	}//addRelations2Structure
	
}//odal.OMSDatasource